// CherryMerry ( Mikhail Tomilenko ), Reverse Entertainment, 2021-2024


#include "Enemy_HealthInfo.h"

#include "Components/TextBlock.h"
#include "Components/ProgressBar.h"

#include <Kismet/KismetMathLibrary.h>

void UEnemy_HealthInfo::UpdateWidgetInfo(float CurrentHealth, float MaxHealth, float CurrentShield, float MaxShield)
{
	TextBlock_CurrentHealth->SetText(FText::AsNumber(CurrentHealth));
	TextBlock_MaxHealth->SetText(FText::AsNumber(MaxHealth));
	ProgressBar_CurrentHealth->SetPercent(UKismetMathLibrary::NormalizeToRange(CurrentHealth, 0, MaxHealth));

	TextBlock_CurrentShield->SetText(FText::AsNumber(CurrentShield));
	TextBlock_MaxShield->SetText(FText::AsNumber(MaxShield));
	ProgressBar_CurrentShield->SetPercent(UKismetMathLibrary::NormalizeToRange(CurrentShield, 0, MaxShield));
}
